.include "2313def.inc"

	ldi r16, 0xFF
	out DDRB, r16	; set Port B as output

	ldi r16, 0x00
	out DDRD, r16	; set Port D as input
	
	ldi r16, 0xFF
	out PORTD, r16	; set Pull-Ups for Port D
	
	ldi r16, 0x00
	out PORTB, r16	; set all pins of Port B to 0
	
loop:
	sbic PIND, 0	; skip next line if Bit 0 of Port D is cleared
	rjmp loop
	sbi PORTB, 0	; set Bit 0 of Port B

ende:
	rjmp ende		; enter infinite loop
